package com.webbdong.aop.agent.test.asm;


import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

public class Asm {

    private String agentId = "1234";



    public static void main(String[] args) {
        new Asm().test();
    }


    public void test() {
        String name = "zhangs";
    }

    public void readField(Object object) throws IllegalAccessException {
        Field[] fields = Asm.class.getDeclaredFields();
        for (Field field : fields) {
//            if (Modifier.isStatic(field.getModifiers())) {
//
//            }
            field.setAccessible(true);
            Object o = field.get(object);
        }
    }

    public void readLocalVariable(Object object) throws IllegalAccessException {
        Field[] fields = Asm.class.getDeclaredFields();
        for (Field field : fields) {
//            if (Modifier.isStatic(field.getModifiers())) {
//
//            }
            field.setAccessible(true);
            Object o = field.get(object);
        }
    }

    public String getAgentId() {
        return agentId;
    }
}
